Skip to content

fix: Update log analytics destination name variable in Bicep#926

Merged
Prajwal-Microsoft merged 1 commit into
devfrom
psl-hb-dcrdestname-fix
May 22, 2026
Merged

fix: Update log analytics destination name variable in Bicep#926
Prajwal-Microsoft merged 1 commit into
devfrom
psl-hb-dcrdestname-fix

Conversation

@Harsh-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request updates the naming and usage of the Log Analytics destination for data collection rules in both Bicep and generated ARM template files. The changes improve maintainability and consistency by replacing hardcoded values with dynamically generated variable names, and ensure correct resource dependencies.

Log Analytics Destination Naming Improvements:

  • Introduced a new variable dcrLogAnalyticsDestinationName in both infra/main.bicep and infra/main_custom.bicep to generate the Log Analytics destination name dynamically, replacing the previous hardcoded value. [1] [2]
  • Updated all references to the Log Analytics destination in the data collection rules modules to use the new variable instead of the hardcoded string 'la--1264800308', ensuring consistency across log destinations and workspace associations. [1] [2] [3] [4] [5] [6]

ARM Template Synchronization:

  • Reflected the new variable and its usage in the generated infra/main.json ARM template, including parameter and variable definitions, and updated all relevant resource properties to use dcrLogAnalyticsDestinationName. [1] [2] [3] [4]
  • Updated the template hash in infra/main.json to reflect the changes.

Resource Dependency Ordering:

  • Fixed the order of dependencies in infra/main.json for private DNS zones, ensuring correct deployment sequencing for cognitive services and storage resources. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Log Analytics destination naming used by the Windows VM Data Collection Rule (DCR) to be dynamically generated (instead of a hardcoded string), and synchronizes the generated ARM template accordingly.

Changes:

  • Introduced a dcrLogAnalyticsDestinationName variable in both infra/main.bicep and infra/main_custom.bicep and updated the DCR configuration to reference it.
  • Updated infra/main.json to include the new variable and use it in the DCR destinations.logAnalytics[].name and dataFlows[].destinations fields.
  • Re-ordered a couple of dependsOn arrays in infra/main.json and updated the template hash.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
infra/main.bicep Adds a variable for the DCR Log Analytics destination name and replaces hardcoded references with the variable.
infra/main_custom.bicep Mirrors the same DCR destination naming change as main.bicep for the custom deployment path.
infra/main.json Reflects the compiled output changes: new variable, updated DCR destination references, and updated template hash / dependency ordering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Prajwal-Microsoft Prajwal-Microsoft merged commit f619b80 into dev May 22, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants